Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[57] get and clean images #84

Merged

Conversation

nicolaes
Copy link
Contributor

@nicolaes nicolaes commented Dec 2, 2023

What does it fix?

Closes #57 : additional suggestions
This includes PR #83.

How has it been tested?

Get uploaded image

GET https://localhost:5001/file/eb8749f3-05a5-4d07-9310-056a2c7ef37d
(id taken from singleUpload mutation response, see testing on #83)

Create theme with an uploaded image

mutation {
  themeCreate(input: { title: "New Theme 4", fileBlobId: "eb8749f3-05a5-4d07-9310-056a2c7ef37d" }) {
    theme {
      id
      title
      thumbnail {
          url,
          fileBlobId
      }
    }
  }
}

New query to get recentImageUploads

{
    recentImageUploads(limit: 2) {
        id,
        createdAt
    }
}

Hangfire cleanup

  1. Created new upload with singleUpload mutation
  2. Manipulated cron frequency in Startup.cs to Minutely and parameters of DeleteOldEntries in FileBlobRepository, to account for more database entries (can also be done by moving CreatedOn column to a few days ago)
  3. Started app and verified orphan entries are removed and dependent entries are not (console logged how many entries were deleted)

@nicolaes nicolaes marked this pull request as ready for review December 4, 2023 09:47
@nicolaes nicolaes changed the title Feature/57 get and clean images [57] get and clean images Dec 7, 2023
TeacherWorkout.Domain/Themes/CreateTheme.cs Outdated Show resolved Hide resolved
Copy link
Member

@idormenco idormenco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@idormenco idormenco merged commit 4158a36 into code4romania:develop Dec 8, 2023
2 checks passed
@nicolaes nicolaes deleted the feature/57-get-and-clean-images branch December 8, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for uploading an image
3 participants